<?php  
 ini_set("display_errors", 0);
my_component_load('xl_builder' , false);
my_component_load('testing' , false);
my_component_load('paging' , false);  
my_component_load('list_kalender' , false);   
my_component_load('jadwal_wk_karyawan' , false);
my_component_load('a_finger_proses_absen' , false);
my_component_load('a_kalkulasi' );

$task = isset($_GET['task']) ? $_GET['task'] : "";   
$id = isset( $_GET['id'] ) ? $_GET['id']:  0; 

switch(	$task ){
	case "kalkulasi_waktu_kerja":
		ini_set("max_execution_time","10000");
		header("Cache-Control: no-cache, must-revalidate");
		$query = "UPDATE opsi_seting SET value='{$_SESSION['user_id']}' WHERE name='kalkulasi'";
		my_query($query);
		trap_data_waktu_kerja(); 
		$query = "UPDATE opsi_seting SET value='0' WHERE name='kalkulasi'";
		my_query($query);
		echo button_icon( 'check2.png' ,'')."<br/>Done !!";
		exit;
	break;
	case "kalkulasi_waktu_all_page":
		$content = page_kalkulasi(); 
		generate_my_web($content,"","plain.php");
		exit;
	break;
	case "kalkulasi":
		facebox_page('index.php?com='.$_GET['com'].'&task=kalkulasi_waktu_all_page&p='.rand(0,999999) , $title , 120	); 
		$pagename =  "Kalkulasi gaji seluruh karyawan";
	break;
	case "harian":
		$content = list_realisasi_karyawan_by_periode_id(); 
		$pagename =  "Realisasi kerja harian";
	break;
	case "excel_report":
	 	header("Content-Type: application/xls");
	 	header("Content-Disposition: attachment;filename=kalkulasi_hari_kerja.xls");
		echo excel_karyawan_hari_kerja_kalkulasi();
		exit;
	break;
	
	default:
		load_facebox_script();
		$content  =  list_karyawan_hari_kerja_kalkulasi();
		$pagename =  "Waktu Kerja _BN_  Proses _BN_ Hasil Kalkulasi ";
	break;
}
  

generate_my_web($content, $pagename );